import request from '@/utils/request'
import { GEN_SERVER } from '@/config/baseUrl'

// 查询车间信息列表
export function listWorkshop(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workshop/list',
    method: 'post',
    data: data
  })
}

// 查询车间信息详细
export function getWorkshop(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workshop/detail',
    method: 'get',
    params: {
        id
    }
  })
}

// 新增/修改车间信息
export function addOrUpdateWorkshop(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workshop/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除车间信息
export function delWorkshop(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workshop/deleteByIds',
    method: 'post',
    params: {
      ids: id
    }
  })
}

// 导出车间信息
export function exportWorkshop(query) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workshop/export',
    method: 'post',
    data: query
  })
}
